let datas = null;
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
    if (xhr.readyState == 4 && xhr.status == 200) {
        datas = JSON.parse(xhr.responseText)
    }
}
xhr.open("GET", `/api/class/Statistics`, false)
xhr.send()

var chartDom = document.getElementsByClassName('echarts')[0];
var myChart = echarts.init(chartDom);
var option;

option = {
    series: [{
        name: 'Access From',
        type: 'pie',
        radius: '50%',
        data: datas,
        emphasis: {
            itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
            }
        }
    }]
};

option && myChart.setOption(option);